# -*- coding: utf-8 -*-
#__author__ = '风中的思绪'

from openerp import models, fields


class ConfigCommonType(models.Model):
    _name = "config.common.type"

    # columns
    code = fields.Char(string="编码", size=50, required=True)
    name = fields.Char(string="名称", size=200, required=True)
    group = fields.Char(string="分组", size=50)
    is_system = fields.Boolean(string="是否系统预设")
    order_no = fields.Integer(string="顺序")
    usable = fields.Boolean(string="是否可用", default=True)
    remark = fields.Text(string="备注")


class ConfigCommonTypeValue(models.Model):
    _name = "config.common.type.value"

    # columns
    type_code = fields.Many2one('config.common.type', '类别',
                                required = True,
                                select = True)
    code = fields.Char(string="编码", size=50, required=True)
    name = fields.Char(string="名称", size=200, required=True)
    group = fields.Char(string="分组", size=50)
    remark = fields.Text(string="备注")
    order_no = fields.Integer(string="顺序")
    usable = fields.Boolean(string="是否可用", default=True)

